#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
const int maxn = 1e5+10;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int d[4][2]={1,0,0,1,-1,0,0,-1},dp[100];
int main() {
    ios::sync_with_stdio(0);
    #ifdef Uncle_drew
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #else
    #endif
    int t,c,d;
    string s;
    cin>>t;
    for(int ca=1;ca<=t;ca++){
        memset(dp,INF,sizeof(dp));
        cin>>c>>d>>s;
        d++;
        dp[0]=0;
        for(int i=0;i<c;i++){
            for(int j=i+1;j<=i+d;j++){
                if(s[j]=='X')   continue;
                dp[j]=min(dp[j],dp[i]+1);
            }
        }
        cout<<"Day #"<<ca<<endl<<c<<" "<<d-1<<endl<<s<<endl;
        if(dp[c-1]==INF)    cout<<"0\n";
        else cout<<dp[c-1]<<endl;
        cout<<endl;
    }
    return 0;
}
